<?xml version='1.0' encoding='UTF-8' ?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:sec="http://www.springframework.org/security/tags"
      xmlns:rich="http://richfaces.org/rich">
<ui:composition>

<div class="page_brick"></div>
<table class="top_navbar">
	<tr>
		<sec:authorize ifAllGranted="ROLE_USER">
			<td>
				<!-- "logoutRequest" is handled by SpringSecurity and is configured in app-prod-security.xml  -->
				<form id="logoutFormId" name="logoutFormName" action="#{request.contextPath}/logoutRequest" method="post">
					<h:commandButton type="submit" value="#{bundle['generic.logout.submit']}" />
				</form>
			</td>
		</sec:authorize>
		<td>
			<h:outputLink value="http://code.google.com/p/java-education/">PROJECT HOMEPAGE</h:outputLink>
		</td>
		<td>
			<h:outputLink value="http://pef.czu.cz">ČZU PEF</h:outputLink>
		</td>
		<td>
			<h:outputLink value="http://www.jena.cz">JENA</h:outputLink>
		</td>
	</tr>
</table>
<h:form>

<table class="skin_chooser">
	<tr>
		<td>
			<strong><h:outputText value="#{bundle['generic.skins.title']}"/></strong>
		</td>
		<td>
			<rich:togglePanel id="skin_chooser" switchType="ajax" activeItem="#{skinBean.skinChooserState}">
				<rich:togglePanelItem name="basicOffer">
					<a4j:outputPanel>
					<table class="skin_line">
							<tr>
								<td>
					            	<ui:include src="/templates/include/selectSkin.xhtml">
					                	<ui:param name="skinName" value="BlueSky" />
					                	<ui:param name="skinValue" value="blueSky" />
					            	</ui:include>
								</td>
								<td>
					            	<ui:include src="/templates/include/selectSkin.xhtml">
					                	<ui:param name="skinName" value="Classis" />
					                	<ui:param name="skinValue" value="classic" />
					            	</ui:include>
								</td>
								<td class="control">
									<a4j:commandButton value="#{bundle['generic.skins.more']}">
										<rich:toggleControl targetItem="extendedOffer" event="click"/>
										<a4j:param assignTo="#{skinBean.skinChooserState}" value="extendedOffer"/>
									</a4j:commandButton>
								</td>
							</tr>
					</table>
					</a4j:outputPanel>
				</rich:togglePanelItem>
				<rich:togglePanelItem name="extendedOffer">
					<a4j:outputPanel>
					<table class="skin_line">
							<tr>
								<td>
					            	<ui:include src="/templates/include/selectSkin.xhtml">
					                	<ui:param name="skinName" value="BlueSky" />
					                	<ui:param name="skinValue" value="blueSky" />
					            	</ui:include>
								</td>
								<td>
					            	<ui:include src="/templates/include/selectSkin.xhtml">
					                	<ui:param name="skinName" value="Classis" />
					                	<ui:param name="skinValue" value="classic" />
					            	</ui:include>
								</td>
								<td>
					            	<ui:include src="/templates/include/selectSkin.xhtml">
					                	<ui:param name="skinName" value="Deep Marine" />
					                	<ui:param name="skinValue" value="deepMarine" />
					            	</ui:include>
								</td>
								<td>
					            	<ui:include src="/templates/include/selectSkin.xhtml">
					                	<ui:param name="skinName" value="Emerald Town" />
					                	<ui:param name="skinValue" value="emeraldTown" />
					            	</ui:include>
								</td>
								<td>
					            	<ui:include src="/templates/include/selectSkin.xhtml">
					                	<ui:param name="skinName" value="Japan Cherry" />
					                	<ui:param name="skinValue" value="japanCherry" />
					            	</ui:include>
								</td>
								<td>
					            	<ui:include src="/templates/include/selectSkin.xhtml">
					                	<ui:param name="skinName" value="Ruby" />
					                	<ui:param name="skinValue" value="ruby" />
					            	</ui:include>
								</td>
								<td>
					            	<ui:include src="/templates/include/selectSkin.xhtml">
					                	<ui:param name="skinName" value="Wine" />
					                	<ui:param name="skinValue" value="wine" />
					            	</ui:include>
								</td>
								<td class="control">
									<a4j:commandButton value="#{bundle['generic.skins.less']}">
										<rich:toggleControl targetItem="basicOffer" event="click"/>
										<a4j:param assignTo="#{skinBean.skinChooserState}" value="basicOffer"/>
									</a4j:commandButton>									
								</td>
							</tr>
					</table> 
					</a4j:outputPanel>
				</rich:togglePanelItem>
			</rich:togglePanel>
		</td>
		<td align="right" width="100%">
			<a4j:commandLink reRender="entireScreen">
				<h:graphicImage value="/images/country_flags/en.png" rendered="#{localeBean.language == 'en'}" alt="English" border="0" styleClass="pic"/>
				<h:graphicImage value="/images/country_flags/en-inactive.png" rendered="#{localeBean.language != 'en'}" alt="English" border="0" styleClass="pic"/>
            	<a4j:param name="language" value="en" assignTo="#{localeBean.language}" />
			</a4j:commandLink>
			<a4j:commandLink reRender="entireScreen">
				<h:graphicImage value="/images/country_flags/cs.png" rendered="#{localeBean.language == 'cs'}" alt="Čeština" border="0" styleClass="pic"/>
				<h:graphicImage value="/images/country_flags/cs-inactive.png" rendered="#{localeBean.language != 'cs'}" alt="Čeština" border="0" styleClass="pic"/>
            	<a4j:param name="language" value="cs" assignTo="#{localeBean.language}"/>
			</a4j:commandLink>
		</td>
	</tr>
</table>
</h:form>
</ui:composition>
</html>
